﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleDatabaseAdapter
{
    public interface ILists
    {
        /// <summary>
        /// Create table and columns if not exists
        /// </summary>
        void CheckTable();

        /// <summary>
        /// Get all lists
        /// </summary>
        /// <returns>All lists</returns>
        ListDataCollection GetAllLists();

        /// <summary>
        /// Get list
        /// </summary>
        /// <param name="listName">List name</param>
        /// <returns>List</returns>
        ListData GetList(string listName);

        /// <summary>
        /// Get list
        /// </summary>
        /// <param name="listItemsType">AllData item type, based on AllDataItemBase</param>
        /// <returns>List</returns>
        ListData GetList<T>();

        /// <summary>
        /// Check and get list
        /// </summary>
        /// <param name="listItemsType">AllData item type, based on AllDataItemBase</param>
        /// <returns>List</returns>
        ListData CheckAndGetList<T>();

        /// <summary>
        /// Create list and columns if not exists
        /// </summary>
        /// <param name="listItemsType">AllData item type, based on AllDataItemBase</param>
        /// <returns>Is list checked</returns>
        bool CheckList<T>();

        /// <summary>
        /// Get list by static name
        /// </summary>
        /// <param name="listName">Static list name</param>
        /// <returns>List</returns>
        ListData GetListByStaticName(string listName);

        /// <summary>
        /// Get list by title
        /// </summary>
        /// <param name="title">Title</param>
        /// <returns>List</returns>
        ListData GetListByTitle(string title);

        /// <summary>
        /// Get list by id
        /// </summary>
        /// <param name="id">List id</param>
        /// <returns>List</returns>
        ListData GetListById(int id);

        /// <summary>
        /// Check list exists
        /// </summary>
        /// <param name="listName">List name</param>
        /// <returns>Is list exists</returns>
        bool IsListExists(string listName);

        /// <summary>
        /// Add new list
        /// </summary>
        /// <param name="newList">New list data</param>
        void AddList(ListData newList);

        /// <summary>
        /// Add new lists
        /// </summary>
        /// <param name="newLists">New lists data</param>
        void AddLists(ListData[] newLists);

        /// <summary>
        /// Update list
        /// </summary>
        /// <param name="list">List data</param>
        void UpdateList(ListData list);

        /// <summary>
        /// Update lists
        /// </summary>
        /// <param name="lists">Lists data</param>
        void UpdateLists(ListData[] lists);

        /// <summary>
        /// Delete list
        /// </summary>
        /// <param name="id">List id</param>
        void DeleteList(int id);

        /// <summary>
        /// Delete lists
        /// </summary>
        /// <param name="ids">Lists ids</param>
        void DeleteLists(List<int> ids);

        /// <summary>
        /// Get list by index
        /// </summary>
        /// <param name="index">Index</param>
        /// <returns>List</returns>
        ListData this[int index] { get; }

        /// <summary>
        /// Get list by name
        /// </summary>
        /// <param name="listName">List name</param>
        /// <returns>List</returns>
        ListData this[string listName] { get; }
    }
}
